package bizlogic;

import java.util.ArrayList;

import model.PositionDTO;
import exception.DAOSystemException;
import dao.DAOFactory;
import dao.PositionDAO;


public class PositionManager {
	
	private PositionDAO positionDAO;
	public PositionManager() {
		positionDAO = DAOFactory.loadInstance().getPositionDAO();
	}

	@SuppressWarnings("finally")
	public PositionDTO findPosition(String id) throws DAOSystemException{
		PositionDTO currentPosition = new PositionDTO();
			currentPosition = positionDAO.findPosition(id);

			return currentPosition;

		
	}
    @SuppressWarnings("finally")
	public ArrayList<PositionDTO> findAllPosition() throws DAOSystemException {
    	ArrayList<PositionDTO> currentList = new ArrayList<PositionDTO>();
			currentList = positionDAO.findAllPositions();

			return currentList;

    }
    public void insertPosition(PositionDTO position) throws DAOSystemException {
			positionDAO.insertPosition(position);

    }
    public void updatePosition(PositionDTO position) throws DAOSystemException {
			positionDAO.updatePosition(position);

    }
    public void deletePosition(PositionDTO position) throws DAOSystemException {
    		positionDAO.deletePosition(position);

    }

}
